import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/extensions/ex_widget.dart';
import 'package:gourmet/ui/shrink_wrap.dart';
import 'package:gourmet/ui/triangle.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:gourmet/utils/tools.dart';
import 'package:sticky_headers/sticky_headers.dart';

class MineFootprintController extends GetxController {
  List<String> tags = ['满50减3', '100减6', '150减10', '8.5折起', '首单减2', '10P无门槛红包'];

  RxBool isShow = RxBool(false);

  RxBool nextShow = RxBool(false);
}

class MineFooterpintPage extends GetView<MineFootprintController> {
  const MineFooterpintPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeBottom: true,
      removeLeft: true,
      removeRight: true,
      removeTop: true,
      child: Scaffold(
        backgroundColor: Colors.white,
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(44 + Get.mediaQuery.padding.top),
          child: AnnotatedRegion<SystemUiOverlayStyle>(
            value: SystemUiOverlayStyle.dark,
            child: Container(
              color: Colors.white,
              child: Column(
                children: [
                  Container(
                    padding: EdgeInsets.only(top: Get.mediaQuery.padding.top),
                    height: 44 + Get.mediaQuery.padding.top,
                    child: Stack(
                      children: [
                        Container(
                          alignment: Alignment.center,
                          height: 44,
                          child: Text(
                            '我的足迹',
                            style: StylesUtils.customTextStyle(
                              fontWeight: FontWeight.w700,
                              fontSize: StylesUtils.fontSize16,
                              color: ColorsUtils.color0000,
                            ),
                          ),
                        ),
                        Positioned(
                          top: 0,
                          left: 0,
                          child: Container(
                            width: 40,
                            height: 44,
                            alignment: Alignment.center,
                            child: Icon(
                              CupertinoIcons.chevron_back,
                              size: 20.sp,
                              color: HexColor(ColorsUtils.color0000),
                            ),
                          ).onTap(Get.back),
                        ),
                        Positioned(
                          right: 0,
                          top: 0,
                          child: Container(
                            width: 60,
                            height: 44,
                            alignment: Alignment.center,
                            child: Text(
                              '编辑',
                              style: StylesUtils.customTextStyle(
                                fontSize: StylesUtils.fontSize12,
                                color: ColorsUtils.color0000,
                              ),
                            ),
                          ).onTap(() {}),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        body: ListView(
          children: [
            StickyHeader(
              header: Container(
                padding: const EdgeInsets.symmetric(vertical: 15),
                child: Row(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(left: 15),
                      alignment: Alignment.center,
                      child: Text(
                        '今天',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize13,
                          color: ColorsUtils.color0000,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        padding: const EdgeInsets.only(left: 10),
                        child: Container(
                          height: 1,
                          color: HexColor(ColorsUtils.colorF5f5),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
              content: Column(
                children: [
                  Padding(
                    padding:
                        const EdgeInsets.only(bottom: 20, left: 15, right: 15),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Image.network(
                          'https://img1.baidu.com/it/u=4078247928,1880753920&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
                          width: 60,
                          height: 60,
                          fit: BoxFit.fill,
                        ),
                        Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.start,
                            children: [
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '华莱士-凤凰广场2店',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      fontWeight: FontWeight.w700,
                                      color: ColorsUtils.color0000,
                                    ),
                                  ),
                                  PopupMenuButton<int>(
                                    itemBuilder: (_) {
                                      return [
                                        PopupMenuItem(
                                          value: 1,
                                          child: Stack(
                                            children: [
                                              Container(
                                                constraints:
                                                    const BoxConstraints.expand(
                                                        width: 90, height: 40),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '我要收藏',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize15,
                                                  ),
                                                ),
                                              ),
                                              Transform.translate(
                                                offset: const Offset(30, -22),
                                                child: Container(
                                                  height: 10,
                                                  color: Colors.transparent,
                                                  alignment: Alignment.center,
                                                  child: CustomPaint(
                                                    size: const Size(15, 10),
                                                    painter: TrianglePainter(
                                                      isDown: false,
                                                      color: HexColor(
                                                              ColorsUtils
                                                                  .color3333)
                                                          .withOpacity(
                                                              0.898039),
                                                    ),
                                                  ),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                        PopupMenuItem(
                                          value: 2,
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 90, height: 40),
                                            alignment: Alignment.center,
                                            child: Text(
                                              '找相似的',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                fontSize:
                                                    StylesUtils.fontSize15,
                                              ),
                                            ),
                                          ),
                                        )
                                      ];
                                    },
                                    elevation: 0,
                                    padding: EdgeInsets.zero,
                                    color: HexColor(ColorsUtils.color3333)
                                        .withOpacity(0.898039),
                                    splashRadius: 5,
                                    position: PopupMenuPosition.under,
                                    constraints:
                                        const BoxConstraints(maxWidth: 90),
                                    offset: const Offset(10, 10),
                                    child: Icon(
                                      CupertinoIcons.ellipsis,
                                      size: 15,
                                      color: HexColor(
                                        ColorsUtils.color0000,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin:
                                    const EdgeInsets.only(top: 10, bottom: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(
                                      TextSpan(
                                        children: [
                                          TextSpan(
                                            text: '4.5分  ',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.colorFf66,
                                            ),
                                          ),
                                          TextSpan(
                                            text: '月售502  人均￥45',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.color7979,
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Container(
                                      constraints: const BoxConstraints.expand(
                                          width: 60, height: 20),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(3),
                                        color:
                                            ColorsUtils.rgba(250, 245, 245, 1),
                                      ),
                                      alignment: Alignment.center,
                                      child: Text(
                                        '平台专送',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize12,
                                          color: ColorsUtils.colorFf64,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '起送￥20  免配送费',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                  Text(
                                    '20分钟  2.2km',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin: const EdgeInsets.only(top: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Obx(
                                      () => ShrinkWrap(
                                        spacing: 5,
                                        runSpacing: 15,
                                        alignment: WrapAlignment.start,
                                        crossAxisAlignment:
                                            WrapCrossAlignment.center,
                                        maxLines:
                                            controller.isShow.isTrue ? 100 : 1,
                                        children: controller.tags
                                            .map(
                                              (str) => Builder(builder: (_) {
                                                final style =
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.colorFf64,
                                                  fontSize:
                                                      StylesUtils.fontSize12,
                                                );
                                                final width = ToolsUtils
                                                    .calculateTextWidth(
                                                        style: style,
                                                        value: str);
                                                return Container(
                                                  constraints:
                                                      BoxConstraints.expand(
                                                          width: width + 10,
                                                          height: 16),
                                                  decoration: BoxDecoration(
                                                    borderRadius:
                                                        BorderRadius.circular(
                                                            3),
                                                    border: Border.all(
                                                      color: HexColor(
                                                          ColorsUtils
                                                              .colorFf64),
                                                    ),
                                                  ),
                                                  alignment: Alignment.center,
                                                  child: Text(
                                                    str,
                                                    style: style,
                                                  ),
                                                );
                                              }),
                                            )
                                            .toList(),
                                      ),
                                    ).expand(),
                                    Obx(
                                      () => Container(
                                        width: 30,
                                        alignment: Alignment.topCenter,
                                        padding: const EdgeInsets.only(top: 2),
                                        child: Icon(
                                          controller.isShow.isTrue
                                              ? CupertinoIcons.chevron_up
                                              : CupertinoIcons.chevron_down,
                                          size: 10,
                                          color:
                                              HexColor(ColorsUtils.color9999),
                                        ),
                                      ).onTap(
                                        () {
                                          controller.isShow.value =
                                              !controller.isShow.value;
                                        },
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ).expand(),
                      ],
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.only(left: 15, right: 15),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Image.network(
                          'https://img2.baidu.com/it/u=146979649,719452986&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
                          width: 60,
                          height: 60,
                          fit: BoxFit.fill,
                        ),
                        Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.start,
                            children: [
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '麦当劳-凤凰广场店',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      fontWeight: FontWeight.w700,
                                      color: ColorsUtils.color0000,
                                    ),
                                  ),
                                  PopupMenuButton<int>(
                                    itemBuilder: (_) {
                                      return [
                                        PopupMenuItem(
                                          value: 1,
                                          child: Stack(
                                            children: [
                                              Container(
                                                constraints:
                                                    const BoxConstraints.expand(
                                                        width: 90, height: 40),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '我要收藏',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize15,
                                                  ),
                                                ),
                                              ),
                                              Transform.translate(
                                                offset: const Offset(30, -22),
                                                child: Container(
                                                  height: 10,
                                                  color: Colors.transparent,
                                                  alignment: Alignment.center,
                                                  child: CustomPaint(
                                                    size: const Size(15, 10),
                                                    painter: TrianglePainter(
                                                      isDown: false,
                                                      color: HexColor(
                                                              ColorsUtils
                                                                  .color3333)
                                                          .withOpacity(
                                                              0.898039),
                                                    ),
                                                  ),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                        PopupMenuItem(
                                          value: 2,
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 90, height: 40),
                                            alignment: Alignment.center,
                                            child: Text(
                                              '找相似的',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                fontSize:
                                                    StylesUtils.fontSize15,
                                              ),
                                            ),
                                          ),
                                        )
                                      ];
                                    },
                                    elevation: 0,
                                    padding: EdgeInsets.zero,
                                    color: HexColor(ColorsUtils.color3333)
                                        .withOpacity(0.898039),
                                    splashRadius: 5,
                                    position: PopupMenuPosition.under,
                                    constraints:
                                        const BoxConstraints(maxWidth: 90),
                                    offset: const Offset(10, 10),
                                    child: Icon(
                                      CupertinoIcons.ellipsis,
                                      size: 15,
                                      color: HexColor(
                                        ColorsUtils.color0000,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin:
                                    const EdgeInsets.only(top: 10, bottom: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(
                                      TextSpan(
                                        children: [
                                          TextSpan(
                                            text: '4.5分  ',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.colorFf66,
                                            ),
                                          ),
                                          TextSpan(
                                            text: '月售502  人均￥45',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.color7979,
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Container(
                                      constraints: const BoxConstraints.expand(
                                          width: 60, height: 20),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(3),
                                        color:
                                            ColorsUtils.rgba(250, 245, 245, 1),
                                      ),
                                      alignment: Alignment.center,
                                      child: Text(
                                        '平台专送',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize12,
                                          color: ColorsUtils.colorFf64,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '起送￥20  免配送费',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                  Text(
                                    '20分钟  2.2km',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin: const EdgeInsets.only(top: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Obx(
                                      () => ShrinkWrap(
                                        spacing: 5,
                                        runSpacing: 15,
                                        alignment: WrapAlignment.start,
                                        crossAxisAlignment:
                                            WrapCrossAlignment.center,
                                        maxLines: controller.nextShow.isTrue
                                            ? 100
                                            : 1,
                                        children: controller.tags
                                            .map(
                                              (str) => Builder(builder: (_) {
                                                final style =
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.colorFf64,
                                                  fontSize:
                                                      StylesUtils.fontSize12,
                                                );
                                                final width = ToolsUtils
                                                    .calculateTextWidth(
                                                        style: style,
                                                        value: str);
                                                return Container(
                                                  constraints:
                                                      BoxConstraints.expand(
                                                          width: width + 10,
                                                          height: 16),
                                                  decoration: BoxDecoration(
                                                    borderRadius:
                                                        BorderRadius.circular(
                                                            3),
                                                    border: Border.all(
                                                      color: HexColor(
                                                          ColorsUtils
                                                              .colorFf64),
                                                    ),
                                                  ),
                                                  alignment: Alignment.center,
                                                  child: Text(
                                                    str,
                                                    style: style,
                                                  ),
                                                );
                                              }),
                                            )
                                            .toList(),
                                      ),
                                    ).expand(),
                                    Obx(
                                      () => Container(
                                        width: 30,
                                        alignment: Alignment.topCenter,
                                        padding: const EdgeInsets.only(top: 2),
                                        child: Icon(
                                          controller.nextShow.isTrue
                                              ? CupertinoIcons.chevron_up
                                              : CupertinoIcons.chevron_down,
                                          size: 10,
                                          color:
                                              HexColor(ColorsUtils.color9999),
                                        ),
                                      ).onTap(
                                        () {
                                          controller.nextShow.value =
                                              !controller.nextShow.value;
                                        },
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ).expand(),
                      ],
                    ),
                  ),
                ],
              ),
            ),
            StickyHeader(
              header: Container(
                padding: const EdgeInsets.symmetric(vertical: 15),
                child: Row(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(left: 15),
                      alignment: Alignment.center,
                      child: Text(
                        '10月15日',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize13,
                          color: ColorsUtils.color0000,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        padding: const EdgeInsets.only(left: 10),
                        child: Container(
                          height: 1,
                          color: HexColor(ColorsUtils.colorF5f5),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
              content: Column(
                children: [
                  Padding(
                    padding:
                        const EdgeInsets.only(bottom: 20, left: 15, right: 15),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Image.network(
                          'https://img1.baidu.com/it/u=4078247928,1880753920&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
                          width: 60,
                          height: 60,
                          fit: BoxFit.fill,
                        ),
                        Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.start,
                            children: [
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '华莱士-凤凰广场2店',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      fontWeight: FontWeight.w700,
                                      color: ColorsUtils.color0000,
                                    ),
                                  ),
                                  PopupMenuButton<int>(
                                    itemBuilder: (_) {
                                      return [
                                        PopupMenuItem(
                                          value: 1,
                                          child: Stack(
                                            children: [
                                              Container(
                                                constraints:
                                                    const BoxConstraints.expand(
                                                        width: 90, height: 40),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '我要收藏',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize15,
                                                  ),
                                                ),
                                              ),
                                              Transform.translate(
                                                offset: const Offset(30, -22),
                                                child: Container(
                                                  height: 10,
                                                  color: Colors.transparent,
                                                  alignment: Alignment.center,
                                                  child: CustomPaint(
                                                    size: const Size(15, 10),
                                                    painter: TrianglePainter(
                                                      isDown: false,
                                                      color: HexColor(
                                                              ColorsUtils
                                                                  .color3333)
                                                          .withOpacity(
                                                              0.898039),
                                                    ),
                                                  ),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                        PopupMenuItem(
                                          value: 2,
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 90, height: 40),
                                            alignment: Alignment.center,
                                            child: Text(
                                              '找相似的',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                fontSize:
                                                    StylesUtils.fontSize15,
                                              ),
                                            ),
                                          ),
                                        )
                                      ];
                                    },
                                    elevation: 0,
                                    padding: EdgeInsets.zero,
                                    color: HexColor(ColorsUtils.color3333)
                                        .withOpacity(0.898039),
                                    splashRadius: 5,
                                    position: PopupMenuPosition.under,
                                    constraints:
                                        const BoxConstraints(maxWidth: 90),
                                    offset: const Offset(10, 10),
                                    child: Icon(
                                      CupertinoIcons.ellipsis,
                                      size: 15,
                                      color: HexColor(
                                        ColorsUtils.color0000,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin:
                                    const EdgeInsets.only(top: 10, bottom: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(
                                      TextSpan(
                                        children: [
                                          TextSpan(
                                            text: '4.5分  ',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.colorFf66,
                                            ),
                                          ),
                                          TextSpan(
                                            text: '月售502  人均￥45',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.color7979,
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Container(
                                      constraints: const BoxConstraints.expand(
                                          width: 60, height: 20),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(3),
                                        color:
                                            ColorsUtils.rgba(250, 245, 245, 1),
                                      ),
                                      alignment: Alignment.center,
                                      child: Text(
                                        '平台专送',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize12,
                                          color: ColorsUtils.colorFf64,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '起送￥20  免配送费',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                  Text(
                                    '20分钟  2.2km',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin: const EdgeInsets.only(top: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Obx(
                                      () => ShrinkWrap(
                                        spacing: 5,
                                        runSpacing: 15,
                                        alignment: WrapAlignment.start,
                                        crossAxisAlignment:
                                            WrapCrossAlignment.center,
                                        maxLines:
                                            controller.isShow.isTrue ? 100 : 1,
                                        children: controller.tags
                                            .map(
                                              (str) => Builder(builder: (_) {
                                                final style =
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.colorFf64,
                                                  fontSize:
                                                      StylesUtils.fontSize12,
                                                );
                                                final width = ToolsUtils
                                                    .calculateTextWidth(
                                                        style: style,
                                                        value: str);
                                                return Container(
                                                  constraints:
                                                      BoxConstraints.expand(
                                                          width: width + 10,
                                                          height: 16),
                                                  decoration: BoxDecoration(
                                                    borderRadius:
                                                        BorderRadius.circular(
                                                            3),
                                                    border: Border.all(
                                                      color: HexColor(
                                                          ColorsUtils
                                                              .colorFf64),
                                                    ),
                                                  ),
                                                  alignment: Alignment.center,
                                                  child: Text(
                                                    str,
                                                    style: style,
                                                  ),
                                                );
                                              }),
                                            )
                                            .toList(),
                                      ),
                                    ).expand(),
                                    Obx(
                                      () => Container(
                                        width: 30,
                                        alignment: Alignment.topCenter,
                                        padding: const EdgeInsets.only(top: 2),
                                        child: Icon(
                                          controller.isShow.isTrue
                                              ? CupertinoIcons.chevron_up
                                              : CupertinoIcons.chevron_down,
                                          size: 10,
                                          color:
                                              HexColor(ColorsUtils.color9999),
                                        ),
                                      ).onTap(
                                        () {
                                          controller.isShow.value =
                                              !controller.isShow.value;
                                        },
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ).expand(),
                      ],
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.only(left: 15, right: 15),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Image.network(
                          'https://img2.baidu.com/it/u=146979649,719452986&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
                          width: 60,
                          height: 60,
                          fit: BoxFit.fill,
                        ),
                        Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.start,
                            children: [
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '麦当劳-凤凰广场店',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize16,
                                      fontWeight: FontWeight.w700,
                                      color: ColorsUtils.color0000,
                                    ),
                                  ),
                                  PopupMenuButton<int>(
                                    itemBuilder: (_) {
                                      return [
                                        PopupMenuItem(
                                          value: 1,
                                          child: Stack(
                                            children: [
                                              Container(
                                                constraints:
                                                    const BoxConstraints.expand(
                                                        width: 90, height: 40),
                                                alignment: Alignment.center,
                                                child: Text(
                                                  '我要收藏',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize15,
                                                  ),
                                                ),
                                              ),
                                              Transform.translate(
                                                offset: const Offset(30, -22),
                                                child: Container(
                                                  height: 10,
                                                  color: Colors.transparent,
                                                  alignment: Alignment.center,
                                                  child: CustomPaint(
                                                    size: const Size(15, 10),
                                                    painter: TrianglePainter(
                                                      isDown: false,
                                                      color: HexColor(
                                                              ColorsUtils
                                                                  .color3333)
                                                          .withOpacity(
                                                              0.898039),
                                                    ),
                                                  ),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                        PopupMenuItem(
                                          value: 2,
                                          child: Container(
                                            constraints:
                                                const BoxConstraints.expand(
                                                    width: 90, height: 40),
                                            alignment: Alignment.center,
                                            child: Text(
                                              '找相似的',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                fontSize:
                                                    StylesUtils.fontSize15,
                                              ),
                                            ),
                                          ),
                                        )
                                      ];
                                    },
                                    elevation: 0,
                                    padding: EdgeInsets.zero,
                                    color: HexColor(ColorsUtils.color3333)
                                        .withOpacity(0.898039),
                                    splashRadius: 5,
                                    position: PopupMenuPosition.under,
                                    constraints:
                                        const BoxConstraints(maxWidth: 90),
                                    offset: const Offset(10, 10),
                                    child: Icon(
                                      CupertinoIcons.ellipsis,
                                      size: 15,
                                      color: HexColor(
                                        ColorsUtils.color0000,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin:
                                    const EdgeInsets.only(top: 10, bottom: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text.rich(
                                      TextSpan(
                                        children: [
                                          TextSpan(
                                            text: '4.5分  ',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.colorFf66,
                                            ),
                                          ),
                                          TextSpan(
                                            text: '月售502  人均￥45',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize12,
                                              color: ColorsUtils.color7979,
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Container(
                                      constraints: const BoxConstraints.expand(
                                          width: 60, height: 20),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(3),
                                        color:
                                            ColorsUtils.rgba(250, 245, 245, 1),
                                      ),
                                      alignment: Alignment.center,
                                      child: Text(
                                        '平台专送',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize12,
                                          color: ColorsUtils.colorFf64,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '起送￥20  免配送费',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                  Text(
                                    '20分钟  2.2km',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color7979,
                                      fontSize: StylesUtils.fontSize12,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                margin: const EdgeInsets.only(top: 10),
                                alignment: Alignment.centerLeft,
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Obx(
                                      () => ShrinkWrap(
                                        spacing: 5,
                                        runSpacing: 15,
                                        alignment: WrapAlignment.start,
                                        crossAxisAlignment:
                                            WrapCrossAlignment.center,
                                        maxLines: controller.nextShow.isTrue
                                            ? 100
                                            : 1,
                                        children: controller.tags
                                            .map(
                                              (str) => Builder(builder: (_) {
                                                final style =
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.colorFf64,
                                                  fontSize:
                                                      StylesUtils.fontSize12,
                                                );
                                                final width = ToolsUtils
                                                    .calculateTextWidth(
                                                        style: style,
                                                        value: str);
                                                return Container(
                                                  constraints:
                                                      BoxConstraints.expand(
                                                          width: width + 10,
                                                          height: 16),
                                                  decoration: BoxDecoration(
                                                    borderRadius:
                                                        BorderRadius.circular(
                                                            3),
                                                    border: Border.all(
                                                      color: HexColor(
                                                          ColorsUtils
                                                              .colorFf64),
                                                    ),
                                                  ),
                                                  alignment: Alignment.center,
                                                  child: Text(
                                                    str,
                                                    style: style,
                                                  ),
                                                );
                                              }),
                                            )
                                            .toList(),
                                      ),
                                    ).expand(),
                                    Obx(
                                      () => Container(
                                        width: 30,
                                        alignment: Alignment.topCenter,
                                        padding: const EdgeInsets.only(top: 2),
                                        child: Icon(
                                          controller.nextShow.isTrue
                                              ? CupertinoIcons.chevron_up
                                              : CupertinoIcons.chevron_down,
                                          size: 10,
                                          color:
                                              HexColor(ColorsUtils.color9999),
                                        ),
                                      ).onTap(
                                        () {
                                          controller.nextShow.value =
                                              !controller.nextShow.value;
                                        },
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ).expand(),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
